home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18351 < prev    next >
Encoding:
Text File  |  1996-08-05  |  748 b   |  45 lines

  1. Path: news.ust.hk!ec_wsk
  2. From: ec_wsk@uxmail.ust.hk (Wong Siu Ki)
  3. Newsgroups: comp.lang.c++
  4. Subject: question in c++
  5. Date: 20 Apr 1996 02:07:05 GMT
  6. Organization: The Hong Kong University of Science and Technology
  7. Message-ID: <4l9gs9$4jp@ustsu10.ust.hk>
  8. NNTP-Posting-Host: ustsu4.ust.hk
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. It won't execute the cin in the while loop, how can I solve it?
  12.  
  13. #include <iostream.h>
  14. #include <stdio.h>
  15.  
  16. void main()
  17. {
  18.   int x;
  19.   char command;
  20.   int data[500];
  21.   int temp;
  22.   while (scanf("%d", &temp)!=EOF)
  23.   {
  24.     x++;
  25.     data[x]=temp;
  26.   }
  27.  
  28.   while (command!='e')
  29.   {
  30.     cout << "Enter command:";
  31.     cin >> command;
  32.     cout << "test" << endl;
  33.   }
  34.  
  35. }
  36.  
  37.  
  38. --
  39. K.
  40.  
  41.  
  42. Wong Siu Ki ñ²Ñⁿ░≥
  43. ec_wsk@stu.ust.hk
  44. Economics BSc Year 2
  45.